home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 July / 1987-07.d64 / note printer (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  73 lines

  1. 10 poke53280,2:poke53281,15:poke646,11:print"[147]":gosub480
  2. 20 printspc(19)"notepad"
  3. 30 printspc(19)"printer"
  4. 40 dimvlir(1,127)
  5. 50 fs$="notes":forct=0to15:pd$=pd$+chr$(160):nextct:fs$=left$(fs$+pd$,16)
  6. 60 open15,8,15,"i0"
  7. 70 input#15,er$,em$:ifer$<>"00"thenprinter$+" "+em$:close15:end
  8. 80 t=18:s=1:print"searching for notes"
  9. 90 open2,8,2,"#"
  10. 100 print#15,"u1";2;0;t;s:fc=0:fp=2:bp=5
  11. 110 print#15,"b-p";2;0:get#2,nt$,ns$:t=asc(nt$+chr$(0)):s=asc(ns$+chr$(0))
  12. 120 print#15,"b-p";2;fp:get#2,ft$:ifasc(fs$+chr$(0))=0then190
  13. 130 print#15,"b-p";2;bp
  14. 140 forct=0to15:get#2,bi$:fi=asc(bi$+chr$(0)):iffi>96andfi<123thenfi=fiand223
  15. 150 dn$=dn$+chr$(fi)
  16. 160 nextct
  17. 170 ifdn$=fs$then220
  18. 180 dn$=""
  19. 190 fc=fc+1:iffc=8andt<>0then100
  20. 200 iffc=8andt=0then510
  21. 210 fp=fp+32:bp=bp+32:goto120
  22. 220 print"standby-scanning notepad"
  23. 230 print#15,"b-p";2;bp-2:get#2,vt$,vs$:vt=asc(vt$+chr$(0)):vs=asc(vs$+chr$(0))
  24. 240 print#15,"u1";2;0;vt;vs:print#15,"b-p";2;2
  25. 250 get#2,pt$,ps$
  26. 260 pt=asc(pt$+chr$(0)):ps=asc(ps$+chr$(0)):ifpc=0andpt=0then520
  27. 270 ifpt=0then310
  28. 280 vlir(0,pc)=pt:vlir(1,pc)=ps
  29. 290 pc=pc+1:ifpc=127then310
  30. 300 goto250
  31. 310 close2:close15
  32. 320 ifpc>1thenprint"there are "pc"pages in this notepad":goto340
  33. 330 print"there is 1 page in this notepad"
  34. 340 print"do you want to print the e[146]ntire notepad or a s[146]ingle page;";
  35. 350 input"e/s";an$:ifan$="e"then380
  36. 360 ifan$="s"then420
  37. 370 goto340
  38. 380 forct=0topc-1
  39. 390 gosub530
  40. 400 nextct
  41. 410 printspc(18)"done!":end
  42. 420 print"which page do you want to print 1 -";pc
  43. 430 input"-> ";an$:ct=val(an$)-1:ifct<0orct>pcthenprint"[145][145][145][145]":goto420
  44. 440 gosub530
  45. 450 print"[145][145]do you want to print another page?     "
  46. 460 input"y/n   [157][157][157]";an$:ifan$="y"thenprint"[145][145][145][145]":goto420
  47. 470 printspc(18)"done!":end
  48. 480 forid=1to63:readni:poke895+id,ni:nextid
  49. 490 poke53269,3:poke2041,14:poke53288,11:poke53250,145:poke53251,55
  50. 500 return
  51. 510 printspc(4)"there are no notes on this disk![151]":close15:end
  52. 520 printspc(3)"there are no pages in the notepad![151]":close15:end
  53. 530 c=0:tc=0:np$="":open15,8,15:open2,8,2,"#"
  54. 540 print#15,"u1";2;0;vlir(0,ct);vlir(1,ct)
  55. 550 print#15,"b-p";2;2
  56. 560 get#2,pp$:tc=tc+1
  57. 570 pl=asc(pp$+chr$(0)):ifpl=0then620
  58. 580 ifpl>96andpl<123thenpl=pland223
  59. 590 np$=np$+chr$(pl)
  60. 600 iftc=254then620
  61. 610 goto560
  62. 620 close2:close15
  63. 630 open4,4:print#4,"page ";ct+1:print#4,np$:print#4:close4:return
  64. 640 rem *-> icon (sprite) data <-*
  65. 650 data255,255,255,128,000,001,131,255
  66. 660 data193,130,057,193,131,255,193,130
  67. 670 data000,065,130,000,065,130,000,065
  68. 680 data130,000,065,130,000,065,131,000
  69. 690 data065,130,128,065,131,255,193,128
  70. 700 data000,001,135,255,225,137,036,157
  71. 710 data159,255,253,159,255,253,143,255
  72. 720 data241,128,000,001,255,255,255,167
  73.